<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ajax示例1</title>
    <!-- <script src="https://aliyun.dcloud.net.cn/nvue/index.js"></script> -->
</head>
<body>
    <div id="result"></div>
    <script>
        var xhr = new XMLHttpRequest();
        xhr.open('GET', 'data.txt', true);
        xhr.onreadystatechange = function() {
            if (xhr.status == 200 && xhr.readyState == 4) {
                document.getElementById('result').innerHTML = xhr.responseText;
            }
        };
        xhr.send();
    </script>
</body>
</html>